package mands.utils.weather;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

/**
 * WeatherActivity.java
 * 
 * @author Maze
 * 
 *         Android Activity that displays information gathered by the Weather
 *         utility.
 */
public class WeatherActivity extends Activity {
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		Weather.updateCurrentInformation("78727");
		((TextView) this.findViewById(R.id.txt_city)).append(" 78727");
		((TextView) this.findViewById(R.id.txt_current_condition)).append(" "
				+ Weather.getCurrentConditions().condition);
		((TextView) this.findViewById(R.id.txt_current_humidity))
				.append(Weather.getCurrentConditions().humidity);
		((TextView) this.findViewById(R.id.txt_current_temperature)).append(" "
				+ Weather.getCurrentConditions().temperature);
		((TextView) this.findViewById(R.id.txt_current_wind)).append(" "
				+ Weather.getCurrentConditions().wind);

		((TextView) this.findViewById(R.id.txt_forecast_0))
				.setText("\nToday's Forecast:\n"
						+ Weather.getWeatherForecasts()[0].getFormattedString());
		((TextView) this.findViewById(R.id.txt_forecast_1))
				.setText("\nForecast:\n"
						+ Weather.getWeatherForecasts()[1].getFormattedString());
		((TextView) this.findViewById(R.id.txt_forecast_2)).setText("\n"
				+ Weather.getWeatherForecasts()[2].getFormattedString());
		((TextView) this.findViewById(R.id.txt_forecast_3)).setText("\n"
				+ Weather.getWeatherForecasts()[3].getFormattedString());
	}
}